{% extends 'base.html' %}

{% block content %}
    <h2 class="cl-artical-title">标题：{{ article.title }}</h2>
    <div class="cl-card-tag">
        <div><span>{{ article.total_views }}</span>人浏览 / <span>{{ article.comments_count }}</span>人评论
            <span>{{ article.create_time }}</span></div>
    </div>
    <div class="cl-artical">
        <p>作者:{{ article.author }}</p>

        {#safe反转码#}
        <p>内容：{{ article.content | safe }}</p>
    </div>
    {% block xiangguan %}
        <div class="recommend-panel">
            <h4 class="right-card-title">相关文章</h4>
            <div class="card-deck">

                {% for i in list %}
                    <div class="card ll-panel">
                        <a class="recommend-panel-link" href="?cat_id={{ i.id }}">
                            <div class="recommend-panel">
                                <img src="{{ i.avatar.url }}" class="img-fluid" alt="">
                                <h4 style="color: #2b91af"> 标题：{{ i.title }}</h4>
                            </div>
                        </a>
                    </div>
                {% endfor %}

            </div>
        </div>
    {% endblock %}
    <div class="comment">
        <form class="cl-comment-from" method="post">
            {% csrf_token %}
            <input type="hidden" name="art_id" value="{{ articlies.id }}">
            <div><textarea placeholder="说点什么吧..." rows="1" name="content"></textarea></div>
            <button type="submit">留言</button>
            <span class="clearfix"></span>
        </form>
        <h4 class="right-card-title">全部评论</h4>
        <div class="row">
            {% for comment in comments %}
                <div class="col-12">
                    <hr>
                    <p><strong style="color: pink"></strong></p>
                    <div>
                        <div><span><strong>{{ comment.user.username }}</strong></span>&nbsp;<span
                                style="color: gray">{{ comment.created|date:'Y-m-d H:i' }}</span></div>
                        <br>
                        <p>{{ comment.content|safe }}</p>
                    </div>
                </div>
            {% endfor %}
            <div class="pagenation" style="text-align: center">
                <div id="pagination" class="page"></div>
            </div>
        </div>
    </div>
{% endblock %}


